package org.logic.linguisticSummaries.type25summaries;

import org.logic.fuzzysets.AFuzzySet;
import org.logic.linguisticSummaries.ASummary;

public class SummaryTypeTwo extends ASummary{

	String subject;
	AFuzzySet quantifier;
	AFuzzySet qualifier;
	
	public SummaryTypeTwo(String subject, AFuzzySet quantifier, AFuzzySet qualifier) {
		this.subject = subject;
		this.quantifier = quantifier;
		this.qualifier = qualifier;
	}
	
	@Override
	public String generateSummary() {

		double cardinalValue = qualifier.getCardinalValue()/qualifier.getQualifier().getCardinalValue();
		
		setDegreeOfTruth(quantifier.getMembershipFunction().getMembershipDegree(cardinalValue));
		
		return quantifier.getLabel()+" "+subject+ qualifier.getLabel()+". [T:"+getDegreeOfTruth()+"]";
	}
}
